1. Field of the Invention
This invention relates to a system for generating images, and more particularly, to a ray-tracing system for generating images of three-dimension scenes in real-time.
2. Description of the Related Art
Ray tracing is the term used to describe a method for generating images of three-dimensional scenes. The method involves sending out a system of rays from a viewpoint in a world space. The world space may be populated by a collection of three-dimensional objects. Color values are computed for each of these rays, and the color values determine the pixels of a displayable image. To compute a color value (e.g. a RGB color vector) for a given ray may involve a set of computations such as the following. The point where the ray encounters its first intersection with an object may be determined. At this “primary” intersection point, a reflection ray and a transmission ray may be determined. (The transmission ray may be computed on the basis of Snell's law of optics.) The reflection ray and transmission ray propagate until they intersect with an object. At each of these two “secondary” intersection points, new reflection and transmission rays may be determined. Now the four rays propagate until they hit four intersection points. For the sake of discussion, assume the propagation of rays stops with the four intersection points. Next, a local lighting computation is performed at the four intersection points to determine color values. Then color values at the two secondary intersection points are determined based on local lighting and some linear combination of the color values at the four intersection points. Finally, a color value at the primary intersection point is determine based on local lighting and a linear combination of the color values at the secondary intersection points. Obviously the number of intersection points grows exponentially with the number N of ray spawning stages. Thus, ray tracing is a computationally expensive process. However, the images generated with ray tracing are often more realistic and/or visually pleasing than images generated by other means. Thus, in general, there exists a need for systems and methodologies for performing ray tracing with increased speed.